Component({
  data: {
    selected: 0,
    color: "#999999",
    selectedColor: "#78bc00",
    list: [
      {
        pagePath: "/pages/index/index",
        iconPath: "/images/tabbar/index.jpg",
        selectedIconPath: "/images/tabbar/index.jpg",
        text: "工作"
      }, 
      {
        pagePath: "/pages/helper/index",
        iconPath: "/images/tabbar/helper.jpg",
        selectedIconPath: "/images/tabbar/helper.jpg",
        text: "助手"
      }, 
      {
        pagePath: "/pages/common/index",
        iconPath: "/images/tabbar/code.png",
        selectedIconPath: "/images/tabbar/code.png",
        text: "常用",
        isSpecial: true
      }, 
      {
        pagePath: "/pages/analysis/index",
        iconPath: "/images/tabbar/analysis.jpg",
        selectedIconPath: "/images/tabbar/analysis.jpg",
        text: "分析"
      },
      {
        pagePath: "/pages/my/index",
        iconPath: "/images/tabbar/my.jpg",
        selectedIconPath: "/images/tabbar/my.jpg",
        text: "我"
      }
    ]
  },
  attached() {
  },
  methods: {
    switchTab(e) {
      const data = e.currentTarget.dataset
      const url = data.path
      wx.switchTab({url})
      this.setData({
        selected: data.index
      })
    }
  }
})